trivial-httpd: Fix const-correctness of slash pointer#3579
trivial-httpd: Fix const-correctness of slash pointer#3579kraj wants to merge 1 commit intoostreedev:mainfrom
Conversation
strrchr() returns a 'const char *' when passed a 'const char *' argument. Declare the local 'slash' variable as 'const char *' to match, fixing a build failure with clang when -Werror,-Wincompatible-pointer-types-discards-qualifiers is active. Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
|
Hi @kraj. Thanks for your PR. I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Code Review
This pull request updates the do_get function in src/ostree/ostree-trivial-httpd.c to change the type of the slash variable from char * to const char *, which improves type safety by ensuring the string it points to is treated as immutable. I have no feedback to provide as there were no review comments.
|
@kraj you got unlucky with the build... Since const is only a build-time check, if it builds this is good |
strrchr() returns a 'const char *' when passed a 'const char *' argument. Declare the local 'slash' variable as 'const char *' to match, fixing a build failure with clang when
-Werror,-Wincompatible-pointer-types-discards-qualifiers is active.